package com.iOS.enums;

import com.sun.net.httpserver.Authenticator;

public enum NoteEnum {
    SUCCESS(1,"操作成功")
    ,FAIL(-1,"操作失败")
    ,INNER_ERROR(-3,"服务器内部错误");


    private  int state;
    private String stateinfo;

    NoteEnum(int state, String stateinfo) {
        this.state = state;
        this.stateinfo = stateinfo;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateinfo() {
        return stateinfo;
    }

    public void setStateinfo(String stateinfo) {
        this.stateinfo = stateinfo;
    }

    public static NoteEnum stateof(int state)
    {
        for(NoteEnum stateEnum:values())
        {
            if(stateEnum.getState()==state)
                return stateEnum;
        }
        return null;
    }
}
